import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Home from '../views/Home.vue'
import EmpBasic from '../views/emp/EmpBasic.vue'
import EmpAdv from '../views/emp/EmpAdv.vue'
import PerEmp from '../views/per/PerEmp.vue'
import PerEc from '../views/per/PerEc.vue'
import PerTrain from '../views/per/PerTrain.vue'
import PerSalary from '../views/per/PerSalary.vue'
import PerMv from '../views/per/PerMv.vue'
import SalSob from '../views/sal/SalSob.vue'
import SalSobCfg from '../views/sal/SalSobCfg.vue'
import SalTable from '../views/sal/SalTable.vue'
import SalMonth from '../views/sal/SalMonth.vue'
import SalSearch from '../views/sal/SalSearch.vue'
import StaAll from '../views/sta/StaAll.vue'
import StaScore from '../views/sta/StaScore.vue'
import StaPers from '../views/sta/StaPers.vue'
import staRecord from '../views/sta/StaRecord.vue'
import SysBasic from '../views/sys/SysBasic.vue'
import SysConfig from '../views/sys/SysConfig.vue'
import SysLog from '../views/sys/SysLog.vue'
import SysAdmin from '../views/sys/SysAdmin.vue'
import SysData from '../views/sys/SysData.vue'
import SysInit from '../views/sys/SysInit.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login,
    hidden: true
  },
  {
    path: '/home',
    name: '员工资料',
    component: Home,
    meta: '',
    children: [
      {
        path: '/emp/empBasic',
        name: '基本资料',
        component: EmpBasic
      },
      {
        path: '/emp/empAdv',
        name: '高级资料',
        component: EmpAdv
      }
    ]
  },
  {
    path: '/per',
    name: '人事管理',
    component: Home,
    children: [
      {
        path: '/per/perEmp',
        name: '员工资料',
        component: PerEmp
      },
      {
        path: '/per/perEc',
        name: '员工奖惩',
        component: PerEc
      },
      {
        path: '/per/perTrain',
        name: '员工培训',
        component: PerTrain
      },
      {
        path: '/per/perSalary',
        name: '员工调薪',
        component: PerSalary
      },
      {
        path: '/per/perMv',
        name: '员工调动',
        component: PerMv
      }
    ]
  },
  {
    path: '/sal',
    name: '薪资管理',
    component: Home,
    children: [
      {
        path: '/sal/salSob',
        name: '工资账套管理',
        component: SalSob
      },
      {
        path: '/sal/salSobCfg',
        name: '员工账套设置',
        component: SalSobCfg
      },
      {
        path: '/sal/salTable',
        name: '工资表管理',
        component: SalTable
      },
      {
        path: '/sal/salMonth',
        name: '月末处理',
        component: SalMonth
      },
      {
        path: '/sal/salSearch',
        name: '工资表查询',
        component: SalSearch
      },
    ]
  },
  {
    path: '/sta',
    name: '统计管理',
    component: Home,
    children: [
      {
        path: '/sta/staAll',
        name: '综合信息统计',
        component: StaAll
      },
      {
        path: '/sta/staScore',
        name: '员工积分统计',
        component: StaScore
      },
      {
        path: '/sta/staPers',
        name: '人事信息统计',
        component: StaPers
      },
      {
        path: '/sta/staRecord',
        name: '人事记录统计',
        component: staRecord
      }
    ]
  },
  {
    path: '/sys',
    name: '系统管理',
    component: Home,
    children: [
      {
        path: '/sys/sysBasic',
        name: '基础信息设置',
        component: SysBasic
      },
      {
        path: '/sys/sysConfig',
        name: '系统管理',
        component: SysConfig
      },
      {
        path: '/sys/sysLog',
        name: '操作日志管理',
        component: SysLog
      },
      {
        path: '/sys/sysAdmin',
        name: '操作员管理',
        component: SysAdmin
      },
      {
        path: '/sys/sysData',
        name: '备份恢复数据库',
        component: SysData
      },
      {
        path: '/sys/sysInit',
        name: '初始化数据库',
        component: SysInit
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
